home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////
- // CheckBoxMatrix
- // by Charles Lloyd
- ////////////////////////
-
- id matrixName;
- id selectedItem;
- id selectedItems;
- id valueStringsList;
- id aValue;
- id borderSize;
- id isVertical;
- id cellPadding;
- id cellSpacing;
-
- - awake
- {
- matrixName = @"UserShouldProvide";
- valueStringsList = @("Item 1", "Item 2", "Item 3", "Item 4");
- selectedItems = [NSMutableArray array];
- borderSize = 1;
- isVertical = YES;
- cellSpacing = 0;
- cellPadding = 2;
- }
-
- - setSelectedItem:aValue
- {
- if (aValue) {
- [selectedItems addObject:aValue];
- }
- }
-
- - selectedItem
- {
- if ([selectedItems containsObject:aValue]) {
- return aValue;
- }
- return nil;
- }
-
- //////////////////////////////
- // Hooks
- //////////////////////////////
- - willPrepareForRequest:aRequest inContext:aContext
- {
- [selectedItems removeAllObjects];
- }
-